package com.example.spring;

import com.example.spring.bean.MyFactoryBean;
import com.example.spring.config.SpringConfig;
import com.example.spring.service.TestService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);

//        TestService testService = (TestService) annotationConfigApplicationContext.getBean("testService");
//
//
//        MyFactoryBean myFactoryBean = (MyFactoryBean) annotationConfigApplicationContext.getBean("&myFactoryBean");
//        myFactoryBean.test();
//        SpringApplication.run(Application.class, args);

        Object indexDao = annotationConfigApplicationContext.getBean("indexDao");

        System.out.println(indexDao);
    }

}
